<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-81">
    <%@ include file="/WEB-INF/include/meta.jsp"%>
    <%@ include file="/WEB-INF/include/css.jsp"%>
    <link href="${ctx.resource}/css/goals.css" rel="stylesheet">
    <title>人马君</title>
  </head>
  <body>
    <div class="page-group">
      <div class="page page-current">
        <header class="bar bar-nav fs-header-small">
          <a onclick="window.history.back();" class="icon icon-left pull-left"></a>
          <h1 class="title">目标</h1>
        </header>
        <div class="content goals">
          <div class="goals-grid" style="background: #fbe449;">
            <div class="grid-item">
              <h5 class="goals-title text-center">远期目标</h5>
              <p class="text-center" style="font-size: 0.6rem;">教练会根据您的目标判断合理性及给与适合您的计划</p>
            </div>
            <div class="grid-item">
              <p class="text-center" style="font-size: .6rem; font-weight: 600;"><c:if test="${not empty goal.reachTime or not empty goal.content}">希望在<span style="font-size: 1rem; font-weight: bold;">${goal.reachTime}</span>达成<br/><span style="font-size: 1rem; font-weight: bold;">${goal.content}</span></c:if></p>
            </div>
          </div>

          <div class="content-block" style="padding: 0; margin: 0;width: 27rem;">
            <div class="row no-gutter basic-item basic-header">
              <div class="item" style="width: 3rem;float:left;"></div>
              <c:forEach var="bodyDataType" items="${enums['bodyDataType']}" varStatus="varStatus">
                <div class="item" style="width: 3rem;float:left;">${bodyDataType.description}<c:if test="${not empty bodyDataType.unit}">(${bodyDataType.unit})</c:if></div>
              </c:forEach>
            </div>
            
            <div class="row no-gutter basic-item">
              <div class="item" style="width: 3rem;float:left;background-color: #fff;">入营时</div>
              <c:forEach var="bodyDataType" items="${enums['bodyDataType']}" varStatus="varStatus">
                <div class="item" style="width: 3rem;float:left;">
                  <fmt:formatNumber value='${targets[bodyDataType.alias].currentValue}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber>
                </div>
              </c:forEach>
            </div>
            
            <c:forEach var="week" begin="1" end="${weeks}" step="1">
              <div class="row no-gutter basic-item">
                <div class="item" style="width: 3rem;float:left;background-color: #fff;">第${week}周</div>
                <div class="item" style="width: 3rem;float:left;">
                  <fmt:formatNumber value='${bwhRecords[week].weight}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber>
                </div>
                <div class="item" style="width: 3rem;float:left;">
                  <fmt:formatNumber value='${bwhRecords[week].bodyFatRate}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber>
                </div>
                <div class="item" style="width: 3rem;float:left;">
                  <fmt:formatNumber value='${bwhRecords[week].skeletalMuscle}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber>
                </div>
                <div class="item" style="width: 3rem;float:left;">
                  <fmt:formatNumber value='${bwhRecords[week].bust}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber>
                </div>
                <div class="item" style="width: 3rem;float:left;">
                  <fmt:formatNumber value='${bwhRecords[week].arm}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber>
                </div>
                <div class="item" style="width: 3rem;float:left;">
                  <fmt:formatNumber value='${bwhRecords[week].waist}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber>
                </div>
                <div class="item" style="width: 3rem;float:left;">
                  <fmt:formatNumber value='${bwhRecords[week].hips}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber>
                </div>
                <div class="item" style="width: 3rem;float:left;">
                  <fmt:formatNumber value='${bwhRecords[week].thigh}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber>
                </div>
              </div>
            </c:forEach>
            
            <div class="row no-gutter basic-item">
              <div class="item" style="width: 3rem;float:left;background-color: #fff;">${weeks}周目标</div>
              <c:forEach var="bodyDataType" items="${enums['bodyDataType']}" varStatus="varStatus">
                <div class="item" style="width: 3rem;float:left;">
                  <fmt:formatNumber value='${targets[bodyDataType.alias].coachIdealValue}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber>
                </div>
              </c:forEach>
            </div>
            
            <div class="row no-gutter basic-item">
              <div class="item" style="width: 3rem;float:left;background-color: #fff;">远期目标</div>
              <c:forEach var="bodyDataType" items="${enums['bodyDataType']}" varStatus="varStatus">
                <div class="item" style="width: 3rem;float:left;">
                  <fmt:formatNumber value='${targets[bodyDataType.alias].idealValue}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber>
                </div>
              </c:forEach>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
